$(function () {
    $('#menu').leftMenu({
        "triggerBtn": ".btn"
    }).init();

    var mySwiper = new Swiper('.index-banner', {
        loop: true, // 循环模式选项
        autoplay: {
            delay: 1500,
            stopOnLastSlide: false,
            disableOnInteraction: false,
        },
        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },
    });

    var mySwiper2 = new Swiper('.psb-banner', {
        loop: true, // 循环模式选项
        autoplay: {
            delay: 1500,
            stopOnLastSlide: false,
            disableOnInteraction: false,
        },
        slidesPerView: 3,
        centeredSlides: true,
        spaceBetween: 7,
    });

    var tearData = [
        {name: "四川", all: 200, surplus: 48},
        {name: "浙江", all: 200, surplus: 25},
        {name: "江苏", all: 200, surplus: 32},
        {name: "广东", all: 300, surplus: 91},
        {name: "福建", all: 200, surplus: 76},
        {name: "山东", all: 200, surplus: 64},
        {name: "安徽", all: 150, surplus: 49},
        {name: "江西", all: 100, surplus: 51},
        {name: "广西", all: 100, surplus: 35},
        {name: "海南", all: 80, surplus: 29},
        {name: "河南", all: 150, surplus: 41},
        {name: "湖南", all: 150, surplus: 69},

        {name: "湖北", all: 150, surplus: 42},
        {name: "河北", all: 150, surplus: 61},
        {name: "内蒙古", all: 80, surplus: 52},
        {name: "宁夏", all: 50, surplus: 28},
        {name: "青海", all: 50, surplus: 41},
        {name: "陕西", all: 150, surplus: 34},
        {name: "甘肃", all: 50, surplus: 33},
        {name: "新疆", all: 40, surplus: 25},
        {name: "贵州", all: 150, surplus: 58},
        {name: "云南", all: 150, surplus: 41},
        {name: "重庆", all: 30, surplus: 5},
        {name: "西藏", all: 50, surplus: 30},
        {name: "辽宁", all: 80, surplus: 27},

        {name: "吉林", all: 50, surplus: 15},
        {name: "黑龙江", all: 50, surplus: 20},
        {name: "上海", all: 40, surplus: 15},
    ];
    var taHtm = template("ta-item", {t: tearData});
    // console.log(taHtm);
    $("#tab-nav").html(taHtm);

    var mySwiper3 = new Swiper('.ta-banner', {
        direction: 'vertical', // 垂直切换选项
        loop: true, // 循环模式选项
        autoplay: {
            delay: 200,
            stopOnLastSlide: false,
            disableOnInteraction: false,
        },
        slidesPerView: 5,
        centeredSlides: true,
    })
});
